home *** CD-ROM | disk | FTP | other *** search
- /*
- ••••••••••••••••••••
- DrawShapeOffscreen.c
- David Surovell
-
- this file contains 1 routine that demonstrates drawing a shape into a gx offscreen
- (a qdgx library structure) for a single, one-shot instance.
- ••••••••••••••••••••
- */
-
- #include <Types.h>
-
- #include "graphics types.h"
- #include "graphics errors.h"
- #include "graphics routines.h"
-
- #include "offscreen library.h"
-
-
- void DrawShapeOffscreen(
- offscreen *offGXWorld,
- gxShape targetShape );
-
-
- void DrawShapeOffscreen(
- offscreen *offGXWorld,
- gxShape targetShape )
- {
- gxTransform newXform, savedXform;
-
- if ((offGXWorld == nil) || (targetShape == nil))
- return;
- if (offGXWorld->port == nil)
- return;
-
- savedXform = GXGetShapeTransform( targetShape );
- newXform = GXCopyToTransform( nil, savedXform );
- GXSetTransformViewPorts( newXform, 1L, &(offGXWorld->port) );
- GXSetShapeTransform( targetShape, newXform );
-
- GXDrawShape( targetShape );
-
- GXSetShapeTransform( targetShape, savedXform );
- GXDisposeTransform( newXform );
- }
-
-